package Demo1299.Demo23;

import java.io.FileWriter;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;

public class Demo1 {
    public static void main(String[] args) throws Exception {
        HashMap<String, String> map = new HashMap<>();
        map.put("pid","10");
        map.put("name","张三");
        map.put("age","18");
        Properties pro = new Properties();
        for (Map.Entry<String, String> m : map.entrySet()) {
            pro.setProperty(m.getKey(),m.getValue());
        }
        FileWriter file = new FileWriter("C:\\Daymate\\src\\Demo1299\\Demo23\\mapdata.properties");
        pro.store(file,"=");
        file.close();
    }
}
